package com.cn.wx.servlet.login;

import com.cn.wx.model.UserModel;
import com.cn.wx.service.LoginService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/loginDelete")
public class LoginDeleteServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String id = req.getParameter("id");
//        判断id是否有值
        Integer ids = id == null || id.equals("") ? 0 : Integer.parseInt(id);
        LoginService loginService=new LoginService();
        loginService.delete(ids);
        resp.sendRedirect("/seleteAll");//刷新页面
    }
}
